#include <bits/stdc++.h>
// 2025/02/05
// tag: 
// Author: Zhang Muen
using namespace std;

using int64 = int64_t;

int n, m, k, dp[201][201], presum[201][201];
string a, b;

signed main()
{
    cin >> n >> m >> k;
    cin >> a >> b;
    presum[0][0] = 1;
    for (int i = 1; i <= n; i++)
        for (int j = min(m, i); j >= 1; j--)
            for (int l = min(j, k); l >= 1; l--){
                if (a[i - 1] == b[j - 1])
                    dp[j][l] = dp[j - 1][l] + presum[j - 1][l - 1], dp[j][l] %= 1000000007;
                else
                    dp[j][l] = 0;
                presum[j][l] += dp[j][l], presum[j][l] %= 1000000007;
            }
    cout << presum[m][k];
    return 0;
}